﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace Cstudy.BLL
{
    public class Topics
    {
        public bool AddTopic(MODEL.Topics topics)
        {
            return new DAL.Topics().AddTopic(topics);
        }

        public bool DeleteTopic(int topicid)
        {
            return new DAL.Topics().DeleteTopic(topicid);
        }

        public bool UpdateTopic(MODEL.Topics topic)
        {
            return new DAL.Topics().UpdateTopic(topic);
        }

        public DataSet SelectNewTopic(int count)
        {
            return new DAL.Topics().SelectNewTopic(count);
        }

        public DataSet SelectHotTopic(int count)
        {
            return new DAL.Topics().SelectHotTopic(count);
        }

        public DataSet SearchTopicByTitle(string keyword)
        {
            keyword = "%" + keyword.Replace(" ", "%") + "%";
            return new DAL.Topics().SearchTopicByTitle(keyword);
        }

        public DataSet SearchTopicByContent(string keyword)
        {
            keyword = "%" + keyword.Replace(" ", "%") + "%";
            return new DAL.Topics().SearchTopicByContent(keyword);
        }
    }
}
